package com.spring.ai;

import com.spring.ai.assistant.Assistant;
import com.spring.ai.assistant.AssistantProvider;
import dev.langchain4j.service.spring.AiService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class AssistantTest {

    @Autowired
    private Assistant  assistant;

    /**
     * 1.现在只能实现单轮对话
     */
    @Test
    public void test(){
        String  assistantChat = assistant.getChat("你好");
        System.out.println("assistantChat = " + assistantChat);
    }
    /**
     * 2.实现多轮对话
     */
    @Test
    public void test2(){
        String  assistantChat = assistant.getChat("你好我是谁");
        System.out.println("assistantChat = " + assistantChat);
        String assistantChat1 = assistant.getChat("我小斌斌");
        System.out.println("assistantChat = " + assistantChat1);
        String assistantChat2 = assistant.getChat("我叫什么呀");
        System.out.println("assistantChat = " + assistantChat2);

    }

    /**
     *3.问题：多个用户需要进行记忆隔的操作
     */
    @Autowired
    private AssistantProvider assistantProvider;
    @Test
    public void test3(){
//        String assistantChat = assistantProvider.chat(1, "你好");
//        System.out.println("assistantChat = " + assistantChat);
//        String assistantChat1 = assistantProvider.chat(1, "我小斌斌");
//        System.out.println("assistantChat = " + assistantChat1);
//        String assistantChat2 = assistantProvider.chat(1, "我叫什么呀");
//        System.out.println("assistantChat = " + assistantChat2);
//        String assistantChat3= assistantProvider.chat(2, "我叫什么呀");
//        System.out.println("assistantChat = " + assistantChat3);

    }


}
